1. Technical Field
This disclosure relates generally to lock elision in a data processing system and more specifically to high concurrency transactional lock elision with delayed lock checking in the data processing system.
2. Description of the Related Art
In a multithreaded environment when a data conflict occurs, for example, two or more threads compete for a same data portion (other than a read operation), atomicity of the transaction cannot be guaranteed and a lock may be acquired to prevent data error. A data conflict among the two or more threads may be detected using existing transactional lock elision (TLE) techniques. TLE techniques typically use underlying transactional memory (TM) systems in an attempt to avoid lock acquisition and subsequent release.
In particular, transactional lock elision techniques typically rely on an underlying transactional memory system to detect conflicts associated with memory accesses inside critical sections of code associated with elided locks, and detect acquisitions of such locks. Transactional lock elision allows for a possibility threads acquire locks instead of eliding the locks, for example, when critical sections are not suited for transactional lock elision, or to enable forward progress of a process.
Therefore, transactional lock elision techniques include a step to read an elided-lock inside, at the start, of a transaction and determine whether the lock is free, to enable the transactional memory system to detect concurrent lock acquisitions. Transactional lock elision techniques determine whether a lock is free at a beginning of a transactional lock elision transaction before executing the critical section protected by the elided lock.
Typical solutions to avoid locking include a conservative locking approach. For example, a lock may be acquired only to ensure correctness, rather than when such lock is needed which typically over uses locking and degrades potential code performance. In another example solution a developer follows a particular and more rigid program design including specific and appropriate levels of locking. The careful design enables more optimized performance due to the increased emphasis on program design. In another example, a global locking mechanism may be used to prevent conflicts, particularly in an environment when thread safety cannot be ensured. Global locking typically results in reduced performance.